package task

import (
	"github.com/jinzhu/gorm"
	"kop/modules/mail/models"
	"time"
)

// 定时删除邮件
func Task(dB *gorm.DB) {

	var ticker = time.NewTicker(time.Minute)
	for range ticker.C {

		var timestamp = time.Now().AddDate(0, 0, -14)
		_ = models.DelBeforeDay(dB, 0, timestamp)
	}
}
